package com.ruoyi.project.data.damage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.data.damage.mapper.FractureDamageInfoMapper;
import com.ruoyi.project.data.damage.domain.FractureDamageInfo;
import com.ruoyi.project.data.damage.service.IFractureDamageInfoService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 断裂损伤信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-27
 */
@Service
public class FractureDamageInfoServiceImpl implements IFractureDamageInfoService 
{
    @Autowired
    private FractureDamageInfoMapper fractureDamageInfoMapper;

    /**
     * 查询断裂损伤信息
     * 
     * @param id 断裂损伤信息主键
     * @return 断裂损伤信息
     */
    @Override
    public FractureDamageInfo selectFractureDamageInfoById(Long id)
    {
        return fractureDamageInfoMapper.selectFractureDamageInfoById(id);
    }

    /**
     * 查询断裂损伤信息列表
     * 
     * @param fractureDamageInfo 断裂损伤信息
     * @return 断裂损伤信息
     */
    @Override
    public List<FractureDamageInfo> selectFractureDamageInfoList(FractureDamageInfo fractureDamageInfo)
    {
        return fractureDamageInfoMapper.selectFractureDamageInfoList(fractureDamageInfo);
    }

    /**
     * 新增断裂损伤信息
     * 
     * @param fractureDamageInfo 断裂损伤信息
     * @return 结果
     */
    @Override
    public int insertFractureDamageInfo(FractureDamageInfo fractureDamageInfo)
    {
        fractureDamageInfo.setCreateTime(DateUtils.getNowDate());
        return fractureDamageInfoMapper.insertFractureDamageInfo(fractureDamageInfo);
    }

    /**
     * 修改断裂损伤信息
     * 
     * @param fractureDamageInfo 断裂损伤信息
     * @return 结果
     */
    @Override
    public int updateFractureDamageInfo(FractureDamageInfo fractureDamageInfo)
    {
        return fractureDamageInfoMapper.updateFractureDamageInfo(fractureDamageInfo);
    }

    /**
     * 批量删除断裂损伤信息
     * 
     * @param ids 需要删除的断裂损伤信息主键
     * @return 结果
     */
    @Override
    public int deleteFractureDamageInfoByIds(String ids)
    {
        return fractureDamageInfoMapper.deleteFractureDamageInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除断裂损伤信息信息
     * 
     * @param id 断裂损伤信息主键
     * @return 结果
     */
    @Override
    public int deleteFractureDamageInfoById(Long id)
    {
        return fractureDamageInfoMapper.deleteFractureDamageInfoById(id);
    }
}
